#include <stdio.h>
#include <string.h>
#include <math.h>

main()
{
	// freopen("input", "r", stdin);
	// freopen("output", "w",stdout);

	int icase=0,ncase;
	int i,j,n;
	int score,shu[30];
	int n1,n2,n3, tot,tot2;
	int s1,s2,s3;

	scanf("%d" , &ncase);
	while (ncase-->0)
	{
		scanf("%d%d", &score, &n);
		n1=n2=n3=0;
		for (i=1,tot=tot2=0;i<=n;i++)
		{
			scanf("%d", &shu[i]);
			tot+=shu[i];			
			if (tot<=score)
			{
				n1++;				
			}
		}
		for (i=1,j=n1;i<=n1;i++,j--)
			tot2+=shu[i]*j;
		s1=tot2;


		for (i=1;i<n;i++)
			for (j=i+1;j<=n;j++)
				if (shu[i]>shu[j])
				{
					shu[0]=shu[i];
					shu[i]=shu[j];
					shu[j]=shu[0];
				}
		for (i=1,tot=tot2=0;i<=n;i++)
		{
			tot+=shu[i];		
			if (tot<=score) 
			{
				n2++;
			}
			else break;
		}
		for (i=1,j=n2;i<=n2;i++,j--)
			tot2+=shu[i]*j;
		s2=tot2;
		

		for (i=n,tot=tot2=0;i>=1;i--)
		{
			tot+=shu[i];		
			if (tot<=score)
			{
				n3++;		
			}
			else break;
		}
		for (i=1,j=n3;i<=n3;i++,j--)
			tot2+=shu[i]*j;
		s3=tot2;
		

		printf("Scenario #%d:\n",++icase);
//		printf("n1=%d,n2=%d,n3=%d\n", n1,n2,n3);
		if (n1>n2 && n1>n3) printf("Bill wins with %d solved problems and a score of %d.\n",n1,s1);
		else if (n2>n1 && n2>n3) printf("Steve wins with %d solved problems and a score of %d.\n",n2,s2);
		else if (n3>n1 && n3>n2) printf("Linus wins with %d solved problems and a score of %d.\n",n3,s3);
		else if (n1==n2 && n1!=n3 && s1<s2 ) printf("Bill wins with %d solved problems and a score of %d.\n",n1,s1);
		else if (n1==n2 && n1!=n3 && s1>s2 ) printf("Steve wins with %d solved problems and a score of %d.\n",n2,s2);
		else if (n2==n3 && n1!=n2 && s2<s3 ) printf("Steve wins with %d solved problems and a score of %d.\n",n2,s2);
		else if (n2==n3 && n1!=n2 && s2>s3 ) printf("Linus wins with %d solved problems and a score of %d.\n",n3,s3);
		else if (n1==n3 && n1!=n2 && s1<s3 ) printf("Bill wins with %d solved problems and a score of %d.\n",n1,s1);
		else if (n1==n3 && n1!=n2 && s1>s3 )  printf("Linus wins with %d solved problems and a score of %d.\n",n3,s3);
		else if (n1==n2 && n1==n3 && s1<s2 && s1<s3) printf("Bill wins with %d solved problems and a score of %d.\n",n1,s1);
		else if (n1==n2 && n1==n3 && s2<s3 && s2<s1) printf("Steve wins with %d solved problems and a score of %d.\n",n2,s2);
		else if (n1==n2 && n1==n3 && s3<s1 && s3<s2) printf("Linus wins with %d solved problems and a score of %d.\n",n3,s3);
		else if (s1==s2 && s2==s3) printf("Steve wins with %d solved problems and a score of %d.\n",n2,s2);
		else printf("Steve wins with %d solved problems and a score of %d.\n",n2,s2);
		printf("\n");
	}


	return 0;
}